package com.factory.absfactory.pizzastore.order;

import com.factory.absfactory.pizzastore.pizza.LDCheesePizza;
import com.factory.absfactory.pizzastore.pizza.LDPepperPizza;
import com.factory.absfactory.pizzastore.pizza.Pizza;

/**
 * @author 薛虎
 * @date 2020/12/24 10:17
 * 这是LD的工厂子类
 */
public class LDFactory implements AbsFactory {
    @Override
    public Pizza createPizza(String orderType) {
        System.out.println("~使用的是抽象工厂模式");
        Pizza pizza = null;
        switch (orderType) {
            case "cheese":
                pizza = new LDCheesePizza();
                break;
            case "pepper":
                pizza = new LDPepperPizza();
                break;
            default:
                return pizza;
        }
        return pizza;
    }
}
